<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>02_v-bind动态绑定class(数组语法)</title>
  </head>
  <body>
    <div id="app">
      <h3 class="title" :class="['active','line']">{{message}}</h3>
      <h3 class="title" :class="getClass()">{{message}}</h3>
    </div>
    <script src="../vue.js"></script>

    <script>
      const app = new Vue({
        el: "#app",
        data: {
          message: "hello",
          active: "aaaaaa",
          line: "bbbbbb",
        },
        methods: {
          getClass: function () {
            return [this.active, this.line];
          },
        },
      });
    </script>
  </body>
</html>
